<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../css/utils/bootstrap.min.css" />
    <link rel="stylesheet" href="../../css/utils/toastr.min.css" />
    <link rel="stylesheet" href="../../css/utils/mui.min.css" />
    <link rel="stylesheet" href="../../css/utils/common.css" />
	<title></title>
	<style>
		.tab-content {
			margin-top: 30px;
		}
		.row-list {
			margin-top: 20px;
		}
		.row-list .thumbnail {
			padding: 8px;
			border: none;
			background: url(../../img/myExtension/content-back.png) no-repeat;
			background-size: 100% 100%;
		}
		.img-layer {
			position: relative;
		}
		.img-layer .main-img {
			height: 166px;
			width: 100%;
			display: block;
		}
		.floating-layer {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color: rgba(0, 0, 0, 0.5);
			z-index: 10;
    		-webkit-transition: all 0.5s ease-in-out;
    		transition: all 0.5s ease-in-out;
    		opacity: 0;
		}
		.float-btn {
			margin-top: 30px;
			text-align: center;
		}
		.float-btn button {
			width: 168px;
		    background-color: #11B5AB;
		    color: #fff;
		    border-color: #11B5AB;
		}
		.float-btn button:focus, .float-btn button:hover {
			color: #fff;
			background-color: #2aeee2;
		}
		.push-time {
			color: #8B8B8B;
		}
		.read-share {
			margin-top: 5px;
			color: #8B8B8B;
		}
		.read-share img {
			width: 14px;
			margin-right: 8px;
			vertical-align: middle;
		}
		.read-share span {
			vertical-align: middle;
		}
		.read-share img:nth-child(3) {
			margin-left: 25px;
		}
		/*预览model*/
		.preview-content {
			display: flex;
		}
		.phone-model {
			width: 260px;
			height: 500px;
			margin: 50px 70px;
			padding: 95px 15px 58px 13px;
			background: url(../../img/myExtension/phone-model.png) no-repeat;
			background-size: 100% 100%;
		}
		.phone-content {
			position: relative;
			width: 100%;
			height: 100%;
			padding: 0 0 10px 10px;
			color: #666666;
		}
		#previewArticle {
			display: none;
			padding-top: 10px;
			padding-bottom: 50px;
		}
		#iframePage {
			display: none;
		}
		.phone-title {
			color: #111;
			/*font-size: 16px;*/
		}
		.phone-body {
			font-size: 12px;
		}
		.phone-body img {
			max-width: 100%;
			height: auto;
		}
		.scan-wechat {
			margin-top: 70px;
		}
		.preview-qrcode {
			width: 386px;
			height: 220px;
			border: 1px solid #A1A1A1;
			text-align: center;
		}
		.preview-qrcode .qrcode {
			width: 150px;
			height: 150px;
			margin: 0 auto;
			margin-top: 25px;
			border: 1px solid #A1A1A1;
		}
		.preview-qrcode .qrcode canvas {
			width: 100%;
			height: 100%;
		}
		.preview-qrcode .prompt {
			margin-top: 10px;
			color: #6B6B6B;
		}
		.wechat-share {
			margin-top: 110px;
			padding: 10px;
			width: 386px;
			height: 132px;
			border: 1px solid #A1A1A1;
		}
		.wechat-title {
			font-size: 16px;
			color: #666666;
		}
		.wechat-content {
			display: flex;
			margin-top: 20px;
		}
		.wechat-describe {
			width: calc(100% - 80px);
			height: 62px;
			color: #8E8E8E;
			display: -webkit-box;
		    overflow: hidden;
		    white-space: normal!important;
		    text-overflow: ellipsis;
		    word-wrap: break-word;
		    -webkit-line-clamp: 3;
		    -webkit-box-orient: vertical;
		}
		.wechat-icon img {
			vertical-align: top;
			margin-left: 10px;
			width: 60px;
			height: 60px;
		}
		/*nar报名卡片*/
		.mui-bar {
			position: absolute;
			font-size: 12px;
		}
		.enroll-tab {
			display: none;
		}
		.mui-bar .mui-btn,.mui-bar button {
			font-size: 12px;
		}
		.title-item {
			display: table-cell;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			vertical-align: middle;
			padding-left: 10px;
			color: #333;
		}
		.btn-item {
			width: 85px;
			display: table-cell;
			text-align: center;
		}
		.mui-bar .mui-btn {
			padding: 6px 12px;
		}
		/*nar名片卡片*/
		.card-tab {
			display: none;
		}
		.merge-tab {
			display: none;
		}
		.user-item {
			position: relative;
			display: table-cell;
			vertical-align: middle;
			padding-left: 5px;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			height: 50px;
		}
		.head-img {
			position: absolute;
			top: -15px;
			width: 45px;
			height: 45px;
			padding: 1px;
			border-radius: 50%;
			background-color: #fff;
		}
		.head-img img {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
		.icon-item {
			display: table-cell;
			width: 30px;
			height: 30px;
			border-left: 1px solid #CBCBCB;
			vertical-align: middle;
 		   	text-align: center;
		}
		.icon-item img {
			width: 15px;
			height: 15px;
		}
		.user-info-bar {
			margin-left: 48px;
			color: #333;
		}
		.user-info-bar .name {
			margin-right: 10px;
		}
		.user-info-bar .position {
			font-size: 12px;
			color: #666666;
		}
		
		.article-div {
			width: 100%;
		}
		.reprinted-btn {
			margin-top: 65px;
			text-align: center;
		}
		.reprinted-btn button {
			width: 168px;
		    background-color: #11B5AB;
		    color: #fff;
		    border-color: #11B5AB;
		}
		.reprinted-btn button:focus, .reprinted-btn button:hover {
			color: #fff;
			background-color: #2aeee2;
		}
		.wechat-article-title {
			font-size: 1.4rem;
		    color: #1673dc;
		    line-height: 25px;
		}
		.article-content {
			display: none;
		}
		.article-abstracts {
			display: none;
		}
	</style>
</head>
<body>
	<div class="content">
		<div class="search-button">
			<div class="search-content">
				<input id="searchInput" type="search" class="form-control" placeholder="输入文章标题">
			</div>
			<div class="btn-group btn-group-justified publish-button" role="group" aria-label="button-group">
				<div class="btn-group" role="group">
					<button type="button" panel-data="tab-panel1" class="btn btn-default active">企业内容库</button>
				</div>
				<div class="btn-group" role="group">
					<button type="button" panel-data="tab-panel2" class="btn btn-default">公共内容库</button>
				</div>
			</div>
		</div>
		<!--<div class="sort-key">
			<label>排序：</label>
			<span class="label active">按价格排序</span>
			<span class="label">按使用次数排序</span>
		</div>-->
		<div class="tab-content">
			<div id="tab-panel1" class="tab-pane active">
				<div class="label-content">
					<div class="label-group">
						<label>标签：</label>
						<span class="label label-default active">不限</span>
					</div>
					<div class="more-label">
						<a href="javascript:void(0)">更多标签</a>
						<img src="../../img/myExtension/more-down.png" />
					</div>
				</div>
				<div class="row row-list">
					<!--<div class="col-sm-6 col-lg-3">
						<div class="thumbnail">
							<div class="img-layer">
								<img class="main-img" src="../../img/test-back.jpg" alt="...">
								<div class="floating-layer">
									<div class="float-btn">
										<p><button class="btn btn-default" type="button">预览</button></p>
										<p><button class="btn btn-default" type="button">获取</button></p>
									</div>
								</div>
							</div>
							<div class="caption">
								<div class="text-title text-ellipsis">文章标题</div>
								<div class="push-time">发布时间：2018-4-19 16:23:05</div>
								<div class="read-share">
									<img src="../../img/myExtension/content-money.png" /><span>免费</span><img src="../../img/myExtension/content-download.png" /><span>12321</span>
								</div>
							</div>
						</div>
					</div>-->
				</div>
				
				<nav id="page" class="text-center" aria-label="Page navigation">
					<ul class="pagination">
					</ul>
				</nav>
			</div>
			<div id="tab-panel2" class="tab-pane">
				<div class="label-content">
					<div class="label-group">
						<label>标签：</label>
						<span class="label label-default active">不限</span>
					</div>
					<div class="more-label">
						<a href="javascript:void(0)">更多标签</a>
						<img src="../../img/myExtension/more-down.png" />
					</div>
				</div>
				<div class="empty_list">输入关键字搜索相关微信文库</div>
				<div class="row article-row-list">
				</div>
			</div>
		</div>
		
		<!--预览model-->
		<div class="modal fade bs-example-modal-lg" id="previewModel" tabindex="-1" role="dialog" aria-labelledby="previewLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content">
					<div class="modal-header">
				    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				    	<h4 class="modal-title" id="previewLabel">预览</h4>
					</div>
				  	<div class="modal-body">
				  		<div class="preview-content">
					    	<div class="phone-model">
					    		<div  class="phone-content">
					    			<div id="previewArticle" class="refresh-scroll">
						    			<!--<p class="phone-title">标题</p>
						    			<h6>2018-5-7 <a>张三丰</a></h6>
						    			<div class="phone-body">
		                            	    
						    			</div>-->
					    			</div>
					    			<iframe src="" id="iframePage" frameborder="0" scrolling="yes" marginwidth="0" marginheight="0" style="height: 280px;width: 216px;"></iframe>
					    			<!--报名-->
									<nav class="mui-bar mui-bar-tab enroll-tab">
										<div class="title-item">
											报名信息防静电索拉卡
										</div>
										<div class="btn-item">
											<button type="button" class="mui-btn btn-theme">立即报名</button>
										</div>
									</nav>
									<!--名片插件管理-->
									<nav class="mui-bar mui-bar-tab card-tab">
										<div class="user-item">
											<!--<a class="head-img">
												<img src="../../img/login/logo2.png" />	
											</a>
											<div class="user-info-bar">
												<span class="name">张三丰</span><span class="position">销售总监</span><br />
												<a class="phone" href="tel:">1383838438</a>
											</div>-->
										</div>
										<div class="icon-item qrcode-item customer-wechat-click">
											<img src="../../img/phone/wechat-icon.png" />
										</div>
										<a class="icon-item phone-item customer-phone-click" href="#">
											<img src="../../img/phone/phone-icon.png" />
										</a>
									</nav>
									<!--名片和报名-->
									<nav class="mui-bar mui-bar-tab merge-tab">
										<div class="user-item">
											<!--<a class="head-img">
												<img src="../../img/login/logo2.png" />	
											</a>
											<div class="user-info-bar">
												<span class="name">用户名字</span><span class="position">销售总监</span><br />
												<a class="phone" href="tel:18685306265">18685306265</a>
											</div>-->
										</div>
										<div class="icon-item qrcode-item customer-wechat-click">
											<img src="../../img/phone/wechat-icon.png" />
										</div>
										<div class="icon-item merge-item">
											<!--<span class="text-11B5AB">报名</span>-->
										</div>
									</nav>
					    		</div>
					    	</div>
					    	<div class="scan-wechat">
					    		<div class="preview-qrcode">
					    			<div class="qrcode"></div>
					    			<div class="prompt">
					    				微信扫一扫，开始分享
					    			</div>
					    		</div>
					    		<div class="wechat-share">
					    			<!--<div class="wechat-title text-ellipsis"></div>
					    			<div class="wechat-content">
					    				<div class="wechat-describe"></div>
					    				<div class="wechat-icon">
					    					<img src="../../img/HBuilder.png"/>
					    				</div>
					    			</div>-->
					    		</div>
					    	</div>
				    	</div>
				  	</div>
				</div>
			</div>
		</div>
	</div>	
	<script type="text/javascript" src="../../js/utils/jquery-1.12.4.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/jquery.cookie.js" ></script>
	<script type="text/javascript" src="../../js/utils/toastr.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/jquery.qrcode.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/page.js" ></script>
	<script type="text/javascript" src="../../js/utils/spin.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/boot.js" ></script>
	<script>
		var userID,companyID,lableID,kewords,pageNum=1,articleType=0;
		var saved = base.getSavedData();
		$(function(){
			userID = $.cookie("userID");
			companyID = $.cookie("companyID");
			toastr.options = {
                "timeOut": 2000,
                "positionClass": "toast-middle-center"
            };
            initGetContent();
            //获取个人标签
			base.postData(base.url.getMyLableList, {userID:userID,companyID:companyID,type:2}, callbackGetMyLableList);
		});
		function initGetContent(){
			var data = {
            	userID:userID,
            	companyID:companyID,
            	lableID:lableID,
            	kewords:kewords,
            	pageNo:pageNum
            }
			base.postData(base.url.getContentList, data, callbackGetContentList);
		}
		function callbackGetContentList(data){
			if (data.success) {
				var html = '';
				for (var i=0; i<data.context.articleList.length; i++) {
					html += pingCompanyContentList(data.context.articleList[i]);
				}
				$(".row-list").html(html);
				if (pageNum == 1){
					//初始化分页
					var totalPage = Math.ceil(data.context.totalPage/10);
					var page = {
						pageIndex:1,//初始页数
						currentPage:1,//当前页
						showPage:5,//显示页数
						totalPage:totalPage,//总页数
						onPageClick: function(page) {
							$("#page").initPage(page);
							pageNum = page.currentPage;
							initGetContent();
			    			return false;  //默认的翻页事件
					    }
					};
					$("#page").initPage(page);
				}
			}else{
				toastr.warning(data.msg);
			}
		}
		function pingCompanyContentList(data) {
			var html = '<div class="col-sm-6 col-lg-3">'+
						'	<div class="thumbnail">'+
						'		<input type="hidden" name="articleID" value="'+data.articleID+'" />'+
						'		<input type="hidden" name="otherUserID" value="'+data.userID+'" />'+
						'		<div class="img-layer">'+
						'			<img class="main-img" src="'+data.articleImage+'" alt="'+data.articleTitle+'">'+
						'			<div class="floating-layer">'+
						'				<div class="float-btn">'+
						'					<p><button class="btn btn-default preview-model" type="button">预览</button></p>'+
						'					<p><button class="btn btn-default obtain-article" type="button">获取</button></p>'+
						'				</div>'+
						'			</div>'+
						'		</div>'+
						'		<div class="caption">'+
						'			<div class="text-title text-ellipsis">'+data.articleTitle+'</div>'+
						'			<div class="push-time">加入时间：'+data.joinTime+'</div>'+
						'			<div class="read-share">'+
						'				<img src="../../img/myExtension/content-download.png" /><span>'+data.downloadNum+'</span>'+
						'			</div>'+
						'		</div>'+
						'	</div>'+
						'</div>';
			return html;
		}
		//标签返回
		function callbackGetMyLableList(data) {
			if (data.success) {
				var lableList = data.context.lableList;
				var html = '<label>标签：</label>'+
						   '<span class="label label-default active unlimited" data-param="">不限</span>';
				for (var i=0; i<lableList.length; i++) {
					html += '<span class="label label-default" data-param="'+lableList[i].id+'">'+lableList[i].lableName+'</span>';
				}
				$(".label-group").html(html);
			}
		}
		//搜索
		$('#searchInput').bind('keyup', function(event) {
			if (event.keyCode == "13") {
		　　　　//回车执行查询
				$(this).blur();
				kewords = $(this).val();
				if (!articleType) {
					pageNum=1;
					initGetContent();
				} else {
					getWeCharArticle();
				}
		　　	}
		});
		//点击标签
		$("#tab-panel1 .label-group").on("click", "span", function(){
			//正反选
			if ($(this).attr("class").indexOf("active") != -1) {
				$(this).removeClass("active");
			}else{
				$(this).addClass("active");
			}
			//不限和其他标签互换
			if ($(this).attr("class").indexOf("unlimited") == -1) {
				$(".unlimited").removeClass("active");
				lableID = "";
				var len = $(".label-group").find("span.active").length;
				$(".label-group").find("span.active").each(function(i){
					if (i == len - 1) {
						lableID += $(this).attr("data-param");
					}else{
						lableID += $(this).attr("data-param") + ",";	
					}
				});
				pageNum=1;
				initGetContent();
			}else {
				$(this).siblings().removeClass("active");
				lableID = "";
				if ($(this).attr("class").indexOf("active") != -1) {
					pageNum=1;
					initGetContent();
				}
			}
		});
		//更多标签
		$(".more-label").click(function(){
			if ($(this).find("img").attr("src").indexOf("more-down") != -1) {
				$(this).find("img").attr("src", "../../img/myExtension/more-up.png");
				$(".label-group").css("width", "1200px");
				$(".label-group").css("height", "auto");
			}else{
				$(this).find("img").attr("src", "../../img/myExtension/more-down.png");
				$(".label-group").css("width", "800px");
				$(".label-group").css("height", "29px");
			}
		});
		//获取文章
		$(".row-list").on("click", ".obtain-article", function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			base.postData(base.url.getContentLibraryArticleInfo, {userID:userID,companyID:companyID,articleID:articleID}, callGetContentLibraryArticleInfo);
		});
		function callGetContentLibraryArticleInfo(data){
			if (data.success) {
				toastr.success("获取内容推文成功");
				pageNum = 1;
				initGetContent();
			}else{
				toastr.warning(data.msg);
			}
		}
		//显示预览model
		$(".row-list").on("click", ".preview-model", function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			var otherUserID = $(this).closest(".thumbnail").find("input[name='otherUserID']").val();
			base.postData(base.url.getArticleInfo, {userID:otherUserID,companyID:companyID,articleID:articleID}, callbackGetArticleInfo);
		});
		//推文详情返回
		function callbackGetArticleInfo(data) {
			if (data.success) {
				if (data.context.category == 1) {
					$("#previewArticle").hide();
					$("#iframePage").attr("src", data.context.contentsLink).show();
				}else{
					var preview = '<p class="phone-title">'+data.context.articleTitle+'</p>'+
				    			  '<h6>'+base.getNowFormatToday()+'&nbsp;<a>'+$.cookie("userName")+'</a></h6>'+
				    			  '<div class="phone-body">'+data.context.articleContent+'</div>';
					$("#previewArticle").html(preview);	
					$("#iframePage").hide();
					$("#previewArticle").show();
				}
				
				$('.preview-qrcode .qrcode').html("");
				$('.preview-qrcode .qrcode').qrcode(data.context.QRCodeUrl);
				var wechat = '<div class="wechat-title text-ellipsis">'+data.context.articleTitle+'</div>'+
		    				'<div class="wechat-content">'+
			    			'	<div class="wechat-describe">'+data.context.articleAbstracts+'</div>'+
			    			'	<div class="wechat-icon">'+
			    			'		<img src="'+data.context.articleImage+'"/>'+
			    			'	</div>'+
			    			'</div>';
				$(".wechat-share").html(wechat);
				//插件管理
				var plugLength = data.context.pluginList.length;
				if (plugLength == 0) {//没有插件
					$("#previewArticle").css("padding-bottom","0");
					$("#iframePage").css("height","347px");
					$(".mui-bar").hide();
				}else if (plugLength == 1) {//一种插件
					$("#previewArticle").css("padding-bottom","50px");
					$("#iframePage").css("height","280px");
					//判断那种插件
					if (data.context.pluginList[0].pluginType == 0){//名片
						var card = data.context.pluginList[0].card;
						var html = '<a class="head-img customer-phone-click" href="tel:'+card.cardUserPhone+'">'+
									'	<img src="'+card.cardHeadImgUrl+'" />'+	
									'</a>'+
									'<div class="user-info-bar">'+
									'	<input type="hidden" name="cardID" value="'+card.id+'" />'+
									'	<span class="name">'+card.cardUserName+'</span><span class="position">'+card.post+'</span><br />'+
									'	<a class="phone customer-phone-click" href="tel:'+card.cardUserPhone+'">'+card.cardUserPhone+'</a>'+
									'</div>';
						$(".card-tab .user-item").html(html);
						$(".card-tab .phone-item").attr("href","tel:"+card.cardUserPhone);
						$(".user-qrcode-img").html('<img src="'+card.wxQcImgUrl+'" />');
						$(".card-tab").css("display","table");
					}else if (data.context.pluginList[0].pluginType == 1) {//报名
						$(".content").css("margin-bottom","50px");
						pluginID = data.context.pluginList[0].pluginID;
						$(".enroll-tab .title-item").text(data.context.pluginList[0].enroll.activityTitle);
						$(".enroll-tab .btn-item button").text(data.context.pluginList[0].enroll.enrollButton);
						$(".enroll-tab").css("display","table");
					}
				}else if (plugLength == 2) {//两种插件
					$("#previewArticle").css("padding-bottom","50px");
					$("#iframePage").css("height","280px");
					for (var i=0; i<data.context.pluginList.length; i++) {
						if (data.context.pluginList[i].pluginType==0) {
							var card = data.context.pluginList[i].card;
							var html = '<a class="head-img customer-phone-click" href="tel:'+card.cardUserPhone+'">'+
										'	<img src="'+card.cardHeadImgUrl+'" />'+	
										'</a>'+
										'<div class="user-info-bar">'+
										'	<input type="hidden" name="cardID" value="'+card.id+'" />'+
										'	<span class="name">'+card.cardUserName+'</span><span class="position">'+card.post+'</span><br />'+
										'	<a class="phone customer-phone-click" href="tel:'+card.cardUserPhone+'">'+card.cardUserPhone+'</a>'+
										'</div>';
							$(".merge-tab .user-item").html(html);
							$(".user-qrcode-img").html('<img src="'+card.wxQcImgUrl+'" />');
						}else if (data.context.pluginList[i].pluginType==1) {
							pluginID = data.context.pluginList[i].pluginID;
							$(".merge-tab .merge-item").html('<span class="font-theme">报名</span>');
						}
					}
					$(".merge-tab").css("display","table");
				}
				$("#previewModel").modal('show');
			}else{
				toastr.warning(data.msg);
			}
		}
		//鼠标悬浮
		$(".row-list, .article-row-list").on("mouseover mouseout", ".thumbnail", function(event){
			if(event.type == "mouseover"){
				//鼠标悬浮
				$(this).find(".floating-layer").css("opacity", "1");
			}else if(event.type == "mouseout"){
				//鼠标离开
				$(this).find(".floating-layer").css("opacity", "0");
			}
		});
		$(".publish-button").on("click", "button", function(){
			$(".publish-button button").removeClass("active");
			$(this).addClass("active");
			var panelId = $(this).attr("panel-data");
			if (panelId == "tab-panel1") {
				articleType = 0;
			} else {
				articleType = 1;
			}
			$(".tab-content .tab-pane").removeClass("active");
			$("#"+panelId).addClass("active");
		});
		function getWeCharArticle(){
			base.setWait('正在搜索微信公共文章。。。');
			base.postData(base.url.getWeCharArticle, {keyword: kewords}, callbackGetWeCharArticle);
		}
		function callbackGetWeCharArticle(data){
			base.clearWait();
			if (data.status==0) {
				var html = '';
				saved.list = data.result.list;
				if (saved.list.length > 0) {
					for (var i=0; i<saved.list.length; i++) {
						html += pingWeCharArticleList(saved.list[i], i);
					}
					$(".empty_list").hide();
					$(".article-row-list").html(html);
				} else {
					$(".empty_list").show();
				}
			} else{
				toastr.warning(data.msg);
			}
		}
		function pingWeCharArticleList(data, index) {
			var html = '<div class="col-sm-6 col-lg-3">'+
						'	<div class="thumbnail">'+
						'		<div class="img-layer">'+
						'			<div class="article-abstracts">'+data.content+'</div>'+
						'			<img class="main-img" src="'+data.pic+'" alt="'+data.title+'" />'+
						'			<div class="floating-layer">'+
						'				<div class="reprinted-btn">'+
						'					<p><button class="btn btn-default reprinted-article" type="button" data-open="'+index+'">转载</button></p>'+
						'				</div>'+
						'			</div>'+
						'		</div>'+
						'		<div class="caption">'+
						'			<a class="wechat-article-title text-ellipsis" target="_blank" href="'+data.url+'">'+data.title+'</a>'+
						'			<div class="push-time">创建时间：'+data.time+'</div>'+
						'			<div class="push-time">来自公众号：'+data.weixinname+'</div>'+
						'		</div>'+
						'	</div>'+
						'</div>';
			return html;
		}
		//转载文章
		$(".article-row-list").on("click", ".reprinted-article", function(){
			var index = $(this).attr("data-open");
			var _abstracts = saved.list[index].content.replace(/<\/?.+?>/g,"").substring(0,54);
			var _imageUrl = saved.list[index].pic;
			var _title = saved.list[index].title;
			var _content = saved.list[index].content;
			var params = {
				userID: userID,
				companyID: companyID,
				title: _title,
				abstracts: _abstracts,
				imageUrl: _imageUrl,
				source: 1,
				content:_content,
			}
			base.postData(base.url.updateArticleInfo, params, function(data) {
				if (data.success) {
					toastr.success("转载成功");
				} else {
					toastr.error(data.msg);
				}
			});
		});
		//点击标签
		$("#tab-panel2 .label-group").on("click", "span", function(){
			$(this).parent().find('span').removeClass("active");
			$(this).addClass("active");
			var _labelName =  $(this).text();
			$("#searchInput").val(_labelName);
			kewords = _labelName;
			getWeCharArticle();
		});
	</script>
</body>
</html>
